﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using Com.Toook.Common;
using System.Data.SQLite;

public partial class nst_ShowPageParam : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Page.IsPostBack)
        {
            InitShowPageParam();
        }
    }
    private void InitShowPageParam()
    {
        string sql = "select id, typeId, typeCode, typeName, totalCount, title, keyword, description, newsSiteId, remark " +
            " from ShowPageParam";
        SQLiteConnection con = SqliteHelper.GetConnection("SQLiteDatabase");
        SQLiteCommand cmd = new SQLiteCommand(sql, con);
        SQLiteDataReader reader = null;
        try
        {
            con.Open();
            reader = cmd.ExecuteReader();
            GridViewShowPageParam.DataSource = reader;
            GridViewShowPageParam.DataBind();            
        }
        catch(Exception ex)
        {
            LogHelper.Log.Error(ex);
        }
        finally
        {
            SqliteHelper.CloseDbResource(con, reader);
        }
    }
}
